ORC-2178: [C++] Add basic RISC-V build system and CPU detection support#2639
ORC-2178: [C++] Add basic RISC-V build system and CPU detection support#2639zhanchangbao-sanechips wants to merge 2 commits into
Conversation
|
Thanks for your interest in working on this! Before proceeding, I have some general questions:
|
Thanks for your questions.
|
8f6bf91 to
156c50c
Compare
I add a RISC-V CI workflow:this.#2644 |
| int64_t LinuxParseRiscvIsa(const std::string& values) { | ||
| int64_t flags = 0; | ||
| // RISC-V ISA string like "rv64imafdcv" contains 'v' for vector extension | ||
| if (values.find('v') != std::string::npos) { |
There was a problem hiding this comment.
Thanks for the reminder. I've updated the implementation to use getauxval(AT_HWCAP) to detect HWCAP_RISCV_RVV instead of parsing the ISA string.
The previous implementation parsed /proc/cpuinfo's "isa" field and checked for the presence of 'v'. This is incorrect because all RISC-V ISA strings start with "rv...", so 'v' in the prefix always matches. Now use getauxval(AT_HWCAP) and HWCAP_RISCV_RVV to detect the vector extension at runtime.
|
Merged. Thanks @zhanchangbao-sanechips @wgtmac ~ |
Appreciate your review and merge. I will send follow-up PRs after the RVV decoder implementation lands to further polish RISC-V support. |
What changes were proposed in this pull request?
add the minimum to get RISC-V support in the build system and CPU detection. This is needed before can start add RVV-optimization.
changes:
BUILD_ENABLE_RVVCMake option (off by default)ConfigSimdLevel.cmakeORC_USER_SIMD_LEVELnow accepts RVV or NONEIf RVV isn't available, it just falls back to scalar code.
Why are the changes needed?
ORC doesn't know anything about RISC-V. This is just the groundwork so follow-up patches can actually use RVV. (https://issues.apache.org/jira/browse/ORC-1971)
How was this patch tested?
-DBUILD_ENABLE_RVV=ON, config passedORC_USER_SIMD_LEVEL=NONEproperly masks out RVV